package com.ms.jsf.util;

import java.io.IOException;
import java.util.Properties;

/**
 * User: kvallejos
 * Date: 09/03/12
 */
public class UtilResource {

    private static String appResourcePath = "com/dpwc/seguridad/application.properties";

    public static Properties getAppPorperties() throws IOException {
        Properties props = getResourcePorperties(appResourcePath);
        return props;
    }

    public static String getApplicationId() throws IOException {
        return getAppPorperties().getProperty("application.id");
    }

    public static Properties getResourcePorperties(String resourcePath) throws IOException {
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        Properties props = new Properties();
        props.load(classLoader.getResourceAsStream(resourcePath));
        return props;
    }
}
